@extends('Layout/base')

@section('title', '个人中心，万表商城')

@section('css')
<link rel="stylesheet" href="{{asset('/common/bootstrap-3.3.7/css/bootstrap.min.css')}}" type="text/css" media="screen, projection">
<link rel="stylesheet" href="{{asset('/common/home/css/user.css')}}" type="text/css" media="screen, projection">
<link rel="stylesheet" href="{{asset('/common/home/css/user.css')}}">
@endsection

@section('main-js')
 <script type="text/javascript" src="{{asset('common/home/js/jquery.js')}}"></script>
    <script type="text/javascript" src="{{asset('common/home/js/jquery-1.12.3.min.js')}}"></script>
<script src="{{asset('/common/home/js/saved_resource')}}"></script>
<script type="text/javascript" src="{{asset('/common/home/js/user.js')}}"></script>
@endsection

@section('main')
<div id="main">
<div class="position">
    <a href="{{asset('/')}}"><strong>首页</strong></a>
    <i>&gt;</i>
    <a href="{{asset('/usercenter')}}" target="_blank" class="c0e7">我的喜悦手表</a>
    <i>&gt;</i>
    <span>我的订单</span>
</div>
<div class="rightArea" style="border: 1px solid #ccc">
    <!-- 便利提醒 Begin -->
    <div class="prompt">
        <div class="pr_top" style=" ">
            <b class="tit">基本资料-密码修改</b>
           <!--  <div id="contact_kf_div2" style="float: right;"><a href="javascript:;" class="btn btn-danger btn-register">编辑</a></div> -->
        </div>

    </div>
    <!-- 便利提醒 End -->

    <div class="clear"></div>
        <!-- order表单 Begin -->
    <div class="odrTab">
        
    </div>
    <div class="account" style="margin-left: 30px">
        <div class="hisOrd">     
                <div class="form-group" style="font-size: 12px">              
                    <ul>                           
                        <li style="line-height: 40px;font-size: 16px;" ><label>亲！完善资料，有助于好友找到你哦！</label></li>

                        <input type="hidden" value="" name="id">
                        <li style="line-height: 40px"><label style="width: 70px">当前密码：</label><input type="password" value="" name="currentpass" style="height: 30px; width: 200px"><span id="errorname"></span></li>
                         <li style="line-height: 40px"><label style="width: 70px">修改密码：</label><input type="password" value="" name="updatapass" style="height: 30px;width: 200px" placeholder=""></li>
                        <li style="line-height: 40px"><label style="width: 70px">确定密码：</label><input type="password" value="" name="confirmpass" style="height: 30px;width: 200px;"></li>                         

                         <span id="success" style="display: block;margin-left:100px ;margin-bottom: 10px"></span>
                        <!-- <li class="bn"><button type="submit" class="btn btn-success" id="submit" style="margin-left: 100px">保存</li>   -->
                        <button type="submit" class="btn btn-danger btn-register" id="submit" style="margin-left: 100px">保存</button>                   
                    </ul>
                 </div>
            <!-- </form> -->
               
        </div>
    </div>
</div>

<!-- 左边菜单 Begin -->
<div class="leftArea">
    <div class="leftArea">
   <!--  <div class="u__mine"><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_index&#39;,&#39;http:user.wbiao.cn/&#39;]);" href="http://user.wbiao.cn/" style="display: block; height: 100%;"></a></div> -->
    <div class="floor">
        <div class="t"><i class="u__trade"></i><font class="f_fixed">交易管理</font></div>
        <div class="c">
            <ul>
                <li><i class="u__point"></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_order&#39;,&#39;/order&#39;]);" href="Script/yonghu.htm" class="ccf0" title="我的订单" rel="nofollow">我的订单 (<span class="cb01">1</span>)</a></li>
                <li><i></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_orderbooking&#39;,&#39;/orderbooking&#39;]);" href="#" title="我的预售" rel="nofollow">我的预售 (<span class="cb01">0</span>)</a></li>
                <li><i></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_address&#39;,&#39;/address&#39;]);" href="#" title="收货地址" rel="nofollow">收货地址</a></li>
                <li><i></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_giftcard&#39;,&#39;/giftcard&#39;]);" href="#" title="礼品卡" rel="nofollow">礼品卡</a></li>
                <li style="border:0;"><i></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_bonus&#39;,&#39;/bonus&#39;]);" href="#" title="代金券/优惠券" rel="nofollow">代金券/优惠券</a></li>
            </ul>
        </div>
    </div>
    <div class="floor">
        <div class="t"><i class="u__datum"></i><font class="f_fixed">账户管理</font></div>
        <div class="c">
            <ul>
                <li><i></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_profile&#39;,&#39;/profile&#39;]);" href="#" title="个人资料" rel="nofollow">个人资料</a></li>
                <li><i></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_password&#39;,&#39;/password&#39;]);" href="#" title="修改密码" rel="nofollow">修改密码</a></li>
                <li><i></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_collection&#39;,&#39;/collection&#39;]);" href="#" title="我的收藏" rel="nofollow">我的收藏</a></li>
                <li><i></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_history_record&#39;,&#39;/history/record&#39;]);" href="#" title="浏览历史" rel="nofollow">浏览历史</a></li>
                <li style="border:0;"><i></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_recommend&#39;,&#39;/recommend&#39;]);" href="http://user.wbiao.cn/recommend" title="为我推荐" rel="nofollow">为我推荐</a></li>
            </ul>
        </div>
    </div>
    <div class="floor">
        <div class="t"><i class="u__integral"></i><font class="f_fixed">积分管理</font></div>
        <div class="c">
            <ul>
                <li><i></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_points&#39;,&#39;/points&#39;]);" href="#" title="我的积分" rel="nofollow">我的积分</a></li>
                <li><i></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_points_detail&#39;,&#39;/points/detail&#39;]);" href="#" title="积分细则" rel="nofollow">积分细则</a></li>
                <li style="border:0;"><i></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_recommend_gift&#39;,&#39;/recommend/gift&#39;]);" href="#" title="推荐有礼" rel="nofollow">推荐有礼</a></li>
            </ul>
        </div>
    </div>
    <div class="floor">
        <div class="t"><i class="u__service"></i><font class="f_fixed">消息管理</font></div>
        <div class="c">
            <ul>
                <li><i></i><a href="#" title="购买咨询" rel="nofollow">购买咨询</a></li>
                <li><i></i><a href="#" title="我的评论" rel="nofollow">我的评论</a></li>
                <li style="border:0;"><i></i><a href="#" title="我的消息" rel="nofollow">我的消息</a></li>
                <li style="border:0;"><i></i><a href="#" title="促销通知" rel="nofollow">促销通知</a></li>
            </ul>
        </div>
    </div>
    <div class="floor">
        <div class="t"><i class="u__star"></i><font class="f_fixed">喜悦手表会员</font></div>
        <div class="c">
            <ul>
                <li><i></i><a href="#" title="会员简介" rel="nofollow">会员简介</a></li>
            </ul>
        </div>
    </div>
    <div class="logout">
        <a href="#" class="c999">退出登录</a>
    </div>
</div></div>
<!-- 左边菜单 End -->

</div>
<div id="floatBox">
    <div id="return">
        <a href="javascript:void(0);" class="c__gotop" title="返回顶部" style="display:none;" rel="nofollow"></a>
    </div>
</div>


<script type="text/javascript">
    $('button#submit').click(function () {
        // alert(2);
        var currentpass = $('input[name="currentpass"]').val();
        var updatapass = $('input[name="updatapass"]').val();
        var confirmpass = $('input[name="confirmpass"]').val();
        $('#success').html('');
        if (!currentpass) {
            $('#success').html('当前密码不能空!').css('color','red');
            return false;
        }

        if (!updatapass) {
            $('#success').html('修改密码不能空!').css('color','red');
            return false;
        }
        if (!confirmpass) {
            $('#success').html('确认密码不能空!').css('color','red');
            return false;
        }
        // $('#errorname').html('');
        // $('#errorphone').html('');
        
        $.ajax({
            type: 'post',
            url: "{{url('/home/personalpasswordupdate')}}",
            data: 'currentpass='+currentpass+'&updatapass='+updatapass+'&_token={{csrf_token()}}'+'&confirmpass='+confirmpass,
            success:function (data) {
                console.log(data);
                // if (data.status==1) {
                //     $('#errorname').html(data.msg).css('color','red');
                //     return false;
                // }
                //  
                 if (data.status==1) {
                    $('#success').html(data.msg).css('color','green');
                    location.href ='{{url("/login")}}';
                }
                if (data.status==2) {
                    $('#success').html(data.msg).css('color','red');
                    return false;
                }
                 if (data.status==3) {
                     $('#success').html(data.msg).css('color','red');
                    return false;
                }
                if (data.status==4) {
                    $('#success').html(data.msg).css('color','red');
                    return false;
                }
            },
            error:function (err) {},
            dataType:'json'
        });
    });

</script>


@endsection
